package com.ruoyi.web.controller.net;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.net.domain.BusiSrtpRoute;
import com.ruoyi.net.service.IBusiSrtpRouteService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 业务-srtp-路径配置Controller
 * 
 * @author net
 * @date 2024-12-05
 */
@Api(tags = "业务-srtp-路径配置")
@RestController
@RequestMapping("/busi/srtp/route")
public class BusiSrtpRouteController extends BaseController
{
    @Autowired
    private IBusiSrtpRouteService busiSrtpRouteService;

    /**
     * 查询业务-srtp-路径配置列表
     */
    @ApiOperation(value = "查询业务-srtp-路径配置列表", httpMethod = "GET")
    @PreAuthorize("@ss.hasPermi('net:route:list')")
    @GetMapping("/list")
    public TableDataInfo list(BusiSrtpRoute busiSrtpRoute)
    {
        startPage();
        List<BusiSrtpRoute> list = busiSrtpRouteService.selectBusiSrtpRouteList(busiSrtpRoute);
        return getDataTable(list);
    }

    /**
     * 导出业务-srtp-路径配置列表
     */
    @ApiOperation(value = "导出业务-srtp-路径配置列表", httpMethod = "POST")
    @PreAuthorize("@ss.hasPermi('net:route:export')")
    @Log(title = "业务-srtp-路径配置", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, BusiSrtpRoute busiSrtpRoute)
    {
        List<BusiSrtpRoute> list = busiSrtpRouteService.selectBusiSrtpRouteList(busiSrtpRoute);
        ExcelUtil<BusiSrtpRoute> util = new ExcelUtil<BusiSrtpRoute>(BusiSrtpRoute.class);
        util.exportExcel(response, list, "业务-srtp-路径配置数据");
    }

    /**
     * 获取业务-srtp-路径配置详细信息
     */
    @ApiOperation(value = "获取业务-srtp-路径配置详细信息", httpMethod = "GET")
    @PreAuthorize("@ss.hasPermi('net:route:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return success(busiSrtpRouteService.selectBusiSrtpRouteById(id));
    }

    /**
     * 新增业务-srtp-路径配置
     */
    @ApiOperation(value = "新增业务-srtp-路径配置", httpMethod = "POST")
    @PreAuthorize("@ss.hasPermi('net:route:add')")
    @Log(title = "业务-srtp-路径配置", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BusiSrtpRoute busiSrtpRoute)
    {
        return toAjax(busiSrtpRouteService.insertBusiSrtpRoute(busiSrtpRoute));
    }

    /**
     * 修改业务-srtp-路径配置
     */
    @ApiOperation(value = "修改业务-srtp-路径配置", httpMethod = "PUT")
    @PreAuthorize("@ss.hasPermi('net:route:edit')")
    @Log(title = "业务-srtp-路径配置", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BusiSrtpRoute busiSrtpRoute)
    {
        return toAjax(busiSrtpRouteService.updateBusiSrtpRoute(busiSrtpRoute));
    }

    /**
     * 删除业务-srtp-路径配置
     */
    @ApiOperation(value = "删除业务-srtp-路径配置", httpMethod = "DELETE")
    @PreAuthorize("@ss.hasPermi('net:route:remove')")
    @Log(title = "业务-srtp-路径配置", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable String[] ids)
    {
        return toAjax(busiSrtpRouteService.deleteBusiSrtpRouteByIds(ids));
    }
}
